//
//  CameraView.swift
//  FangDingDingUI
//
//  Created by iSolar on 2017/11/15.
//  Copyright © 2017年 NOOrganization. All rights reserved.
//

import UIKit

class CameraView: UIView {

    var photoButton : UIButton!
    var cameraButton : UIButton!
    var photoImage : UIImageView!
    var customCameraViewBtn : UIButton!
    var timeLabel : UILabel!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initUI()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func initUI() {
        
        photoButton = UIButton.init(frame: CGRect.init(x: (KWidth - 180 ) / 2, y: 20, width: 80, height: 80))
        photoImage = UIImageView.init(frame: CGRect.init(x: (KWidth - 180 ) / 2 + 100, y: 20, width: 80, height: 80))
        cameraButton = UIButton.init(frame: CGRect.init(x: (KWidth - 180 ) / 2, y: 120, width: 80, height: 80))
        customCameraViewBtn = UIButton.init(frame: CGRect.init(x: (KWidth - 180 ) / 2 + 100, y: 120, width: 80, height: 80))
        timeLabel = UILabel.init(frame: CGRect.init(x: 20, y: self.frame.size.height - 20, width: KWidth - 40, height: 20))
        timeLabel.font = UIFont.boldSystemFont(ofSize: 14)
        timeLabel.textColor = UIColor.black
        timeLabel.textAlignment = .center
        
        self.addSubview(photoButton)
        self.addSubview(photoImage)
        self.addSubview(cameraButton)
        self.addSubview(customCameraViewBtn)
        self.addSubview(timeLabel)
        
        photoButton.setTitle("调用相册", for: .normal)
        cameraButton.setTitle("调用相机", for: .normal)
        customCameraViewBtn.setTitle("自定义\n拍照视图", for: .normal)
        
        photoButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
        cameraButton.titleLabel?.font = UIFont.systemFont(ofSize: 15)
        customCameraViewBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15)
        
        photoButton.setTitleColor(UIColor.black, for: .normal)
        cameraButton.setTitleColor(UIColor.black, for: .normal)
        customCameraViewBtn.setTitleColor(UIColor.black, for: .normal)
        
    }
    
    
}
